﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DaoShopOnline;

namespace ManageCategoriesProducts
{
    public partial class EditCategoryWindow : Window
    {
        public Category CategoryToEdit
        {
            get;
            private set;
        }

        public static readonly DependencyProperty CategoryNameProperty =
            DependencyProperty.Register("CategoryName", typeof(string), typeof(EditCategoryWindow));

        public EditCategoryWindow(Category category)
        {
            InitializeComponent();

            this.CategoryToEdit = category;
            this.DataContext = this.CategoryToEdit;
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void buttonEdit_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}
